-module('ex_8.19_compact_block_mappings').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        46,
        true,
        [],
        0,
        47,
        4,
        1,
        false,
        3,
        16,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        31,
        30,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,3,16},
          {yamerl_doc_end,3,16},
          {yamerl_collection_end,3,16,block,sequence},
          {yamerl_collection_end,3,16,block,mapping},
          {yamerl_collection_end,3,16,block,mapping},
          {yamerl_scalar,3,11,
            {yamerl_tag,3,11,{non_specific,"?"}},
            flow,plain,"white"},
          {yamerl_mapping_value,3,9},
          {yamerl_scalar,3,5,
            {yamerl_tag,3,5,{non_specific,"?"}},
            flow,plain,"moon"},
          {yamerl_mapping_key,3,5},
          {yamerl_collection_start,3,5,
            {yamerl_tag,3,5,{non_specific,"?"}},
            block,mapping},
          {yamerl_mapping_value,3,3},
          {yamerl_collection_end,2,16,block,mapping},
          {yamerl_scalar,2,12,
            {yamerl_tag,2,12,{non_specific,"?"}},
            flow,plain,"blue"},
          {yamerl_mapping_value,2,10},
          {yamerl_scalar,2,5,
            {yamerl_tag,2,5,{non_specific,"?"}},
            flow,plain,"earth"},
          {yamerl_mapping_key,2,5},
          {yamerl_collection_start,2,5,
            {yamerl_tag,2,5,{non_specific,"?"}},
            block,mapping},
          {yamerl_mapping_key,2,3},
          {yamerl_collection_start,2,3,
            {yamerl_tag,2,3,{non_specific,"?"}},
            block,mapping},
          {yamerl_sequence_entry,2,1},
          {yamerl_collection_end,1,14,block,mapping},
          {yamerl_scalar,1,8,
            {yamerl_tag,1,8,{non_specific,"?"}},
            flow,plain,"yellow"},
          {yamerl_mapping_value,1,6},
          {yamerl_scalar,1,3,
            {yamerl_tag,1,3,{non_specific,"?"}},
            flow,plain,"sun"},
          {yamerl_mapping_key,1,3},
          {yamerl_collection_start,1,3,
            {yamerl_tag,1,3,{non_specific,"?"}},
            block,mapping},
          {yamerl_sequence_entry,1,1},
          {yamerl_collection_start,1,1,
            {yamerl_tag,1,1,{non_specific,"?"}},
            block,sequence},
          {yamerl_doc_start,1,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).
